package com.webbei.HAO.action;

import java.util.List;
import java.util.Map;

import com.opensymphony.xwork2.ActionContext;
import com.opensymphony.xwork2.ActionSupport;

import com.webbei.HAO.service.ChSer;
import com.webbei.pojo.Brands;
import com.webbei.pojo.Carseries;
import com.webbei.pojo.Cartypes;
import com.webbei.pojo.Customer;
import com.webbei.pojo.LoveCar;

public class GotoUpdate extends ActionSupport{
    private Customer cus;
    private ChSer ser;
    private LoveCar love;
  //  private List<Car> carlist;
    private List<Carseries> serlist;
    private List<Brands> bralist;
   // private Car car;
    private List<String> strlist;
	public String execute(){
		Map map=ActionContext.getContext().getSession();
	    cus=(Customer) map.get("cus");//ser.cus(id);
	    love=ser.getOnecus();
	    bralist=ser.list();
	   // car=new Car();
	    for(int i=0;i<bralist.size();i++){
	    	if(bralist.get(i).getBrandsId()!=null){
	    	  	//car.setCarbraName(bralist.get(i).getBrandsName());
	    		strlist.add(bralist.get(i).getBrandsName());
	    	  	serlist=ser.carlist(bralist.get(i).getBrandsId());
	    	  	for(int j=0;j<serlist.size();j++){
	    	  		strlist.add("  "+serlist.get(i).getSeriesName());
	    	  	}
	    	}
	    	
	    }
	    return SUCCESS; 
     }

	public Customer getCus() {
		return cus;
	}
	public void setCus(Customer cus) {
		this.cus = cus;
	}
	public ChSer getSer() {
		return ser;
	}
	public void setSer(ChSer ser) {
		this.ser = ser;
	}

	public LoveCar getLove() {
		return love;
	}

	public void setLove(LoveCar love) {
		this.love = love;
	}

	public List<String> getStrlist() {
		return strlist;
	}

	public void setStrlist(List<String> strlist) {
		this.strlist = strlist;
	}
	
	
	
}
